// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 新增系统字典 POST /sysdict/add */
export async function insertParamUsingPost1(body: API.SysDictVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/sysdict/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除系统字典 POST /sysdict/delete */
export async function deleteRoleUsingPost2(body: string[], options?: { [key: string]: any }) {
  return request<API.TradeResult>('/sysdict/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询系统字典列表 POST /sysdict/list */
export async function fetchDictListUsingPost(
  body: API.PageBeanDictListQuery_,
  options?: { [key: string]: any },
) {
  return request<API.TradeResult>('/sysdict/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取指定的字典项列表 GET /sysdict/params/${param0} */
export async function fetchDictionaryParamsUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.fetchDictionaryParamsUsingGETParams,
  options?: { [key: string]: any },
) {
  const { dictName: param0, ...queryParams } = params;
  return request<API.TradeResult>(`/sysdict/params/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 修改系统字典 POST /sysdict/update */
export async function updateRoleUsingPost2(body: API.SysDictVO, options?: { [key: string]: any }) {
  return request<API.TradeResult>('/sysdict/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
